<template>
  <div class="form-group row">
    <label :for="dataId" class="col-3 col-form-label text-right">{{labelText}}</label>
    <select class="col-8 form-control" :id="dataId" @change="$emit('change',$event.target.value)">
      <option
        v-for="(option,index) in options"
        :key="index"
        :value="option.value"
        :selected="option.value == value"
      >{{option.title}}</option>
    </select>
  </div>
</template>
<script>
export default {
  name: "FormGroupSelect",
  model: {
    prop: "value",
    event: "change"
  },
  props: {
    value: {
      default: 0
    },
    options: {
      default: function() {
        return [];
      }
    },
    dataId: {
      default: ""
    },
    labelText: {
      default: ""
    }
  }
};
</script>